home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9826 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: enea.se!usenet
  2. From: tope@enea.se (Tommy Petersson)
  3. Newsgroups: comp.lang.c++
  4. Subject: VC++ 4.0 OLE Components: CPicClipCtrl / CPicture - HELP!
  5. Date: 4 Mar 1996 17:36:23 GMT
  6. Organization: Enea Data AB
  7. Message-ID: <4hf9mn$33j@gordon.enea.se>
  8. NNTP-Posting-Host: fixotrix.enea.se
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.6
  12.  
  13. Hi, I have a problem with Visual C++ 4.0:
  14.  
  15. In a dialog I need to display a small picture in a window, but
  16. the picture displayed will depend on a value in a variable. For
  17. this I use the MS-supplied OLE component Picture Clip Control.
  18.  
  19. The control stores a matrix of small pictures in an object of
  20. class CPicture and by a call to GetGraphicCell I get the chosen
  21. part of the matrix returned as a CPicture object.
  22.  
  23. However, the supplied documentation is totally Visual Basic-
  24. oriented - it just tells me to "set the picture property to the
  25. value returned by the GraphicCell call". Usually a picture control
  26. in VB corresponds to a Static Bitmap control in VC++. Just use
  27. the SetBitmap member function.
  28.  
  29. But - SetBitmap wants a struct HWND and GetGraphicCell returns
  30. a CPicture... And I can't find anything useful in the CPicture
  31. class, since it's not derived fron CWnd or any other class where you
  32. just call another member function which kindly returns a window.
  33.  
  34. Shouldn't I use a static control? Should I put a CPicture in
  35. the dialog instead? How do I get to it then - for the other controls
  36. in the dialog I simply let ClassWizard add member variables but
  37. ClassWizard doesn't understand CPicture. If I change from CStatic
  38. to CPicture I get an error at the DDX call. And I don't think that
  39. a CPicture is automatically displayed in a dialog the same way as
  40. a CStatic is(?)
  41.  
  42. Thanks in advance,
  43. BTW - is this the best newsgroup for this question, I found no VC++
  44. specific?
  45.  
  46. Tommy Petersson
  47. tope@enea.se
  48.  
  49.